import axios from 'axios'

// create an axios instance
const service = axios.create({
  baseURL: 'https://www.fastmock.site/mock/954b6f99d8535977a5debdef75beb2dd/vue_vuetify',
  timeout: 5000 // request timeout
})

service.interceptors.request.use(
  config => {
    return config
  },
  error => {
    return error
  }
)

service.interceptors.response.use(
  response => {
    const res = response.data
    return res
  },
  error => {
    return Promise.reject(new Error(error))
  }
)

export default service
